﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Audio_Edit.aspx.cs" Inherits="AudEdit"
    ValidateRequest="false" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>文章信息 </title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />

    <script src="../js/jUtility.js" type="text/javascript"></script>

    <script type="text/javascript" src="../common/calendar.js"></script>

    <script type="text/javascript" src="../../fckeditor/fckeditor.js"></script>
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
        window.onload = function() {
            if (document.getElementById("content")) {
                var fck = new FCKeditor('content');
                fck.BasePath = "../../fckeditor/";
                fck.Width = "99%";
                fck.Height = "600px"
                fck.ReplaceTextarea();
            }

            //initTextarea("concact");
        }
        function initTextarea(id) {
            if (document.getElementById(id) && document.getElementById(id).style.display != 'none') {
                var fck2 = new FCKeditor(id);
                fck2.BasePath = "../../fckeditor/";

                fck2.Width = "99%";
                fck2.Height = "200px"
                fck2.ReplaceTextarea();
            }
        }
    </script>
    <script type="text/javascript">
        String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); }
        function Rx() {
            var RexObj = {
                errMsg: "$",
                isNum: function (z) { RexObj.errMsg += /^\d+$/.test(z) ? ""  : "排序只能输入数字\n"; },
                isHavetitle: function (y) { RexObj.errMsg += y.length != 0 ? "" : "音频名称不能为空\n"; },
                isVideo: function (x) { RexObj.errMsg += /(.*)+\.(mp3|wma)$/.test(x) ? "" : "必须为音频文件\n"; }
            }
            RexObj.isNum($("#txtOrder").val().trim());
            RexObj.isHavetitle($("#title").val().trim()); //判断名称是否为空
            if ($("#isedit").val() == "$") {
                RexObj.isVideo($("#audFile").val()); //判断是否为音频文件
            }
           if(RexObj.errMsg.trim() != "$") { alert(RexObj.errMsg.substring(1)); return false; } else{  return true; }
          
           
           


        }
        


    </script>

</head>
<body>
    <table width="100%" height="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
            <td height="414" align="left" valign="top" class="rightbg">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="2" bgcolor="#A49B81">
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" background="../images/position_bg.gif" bgcolor="#EEF6FE" class="subnav"
                                        style="background-repeat: repeat-y; background-position: left; padding-left: 6px;
                                        padding-top: 3px;">
                                        <asp:Label ID="headers" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#B0C9E8">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="16">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top" style="padding-left: 10px;">
                            <form id="form1" method="post" runat="server">
                            <asp:HiddenField ID="state" runat="server" />
                            <asp:HiddenField ID="aid" runat="server" />
                            <asp:HiddenField ID="isstaticpub" runat="server" />
                            <asp:HiddenField ID="ordernum" runat="server" />
                            <table width="95%" height="728" border="1" align="center" cellpadding="0" cellspacing="0"
                                bordercolorlight="#2583BC" bordercolordark="#ffffff">
                                <tr>
                                    <td width="100%" height="641" valign="top">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <th align="left" width="80%">
                                                    <asp:Label ID="infoname" runat="server"></asp:Label>
                                                </th>
                                                <th align="left">
                                                    <a href="AudioContent.aspx?layerid=<%=Layerid %>&columnid=<%=Request.Params["columnid"]%>&langid=<%= Request.Params["langid"]%>">
                                                        返回 </a>
                                                </th>
                                            </tr>
                                        </table>
                                        <br>
                                        <table width="100%" border="0">
                                            <tr>
                                                <td width="7%" align="right">
                                                    <font color="#FF0000">* </font>:名称
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="title" runat="server" MaxLength="100" size="50" />
                                                </td>
                                            </tr>
                                            <tr id="Tr_subtitle" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>作者：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="txtAuthor" runat="server" MaxLength="100" size="50" />
                                                </td>
                                            </tr>
                                            <tr id="Tr5" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>排序：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="txtOrder"  runat="server"></asp:TextBox>  
                                                </td>
                                            </tr>
                                            <tr id="Tr2" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>音频：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:FileUpload ID="audFile" runat="server" />  
                                                    <asp:HiddenField ID="isedit" Value="$" runat="server" />

                                                </td>
                                            </tr>
                                            <tr id="Tr3" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>截图：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                   <asp:FileUpload ID="upBigImg" runat="server" />
                                                </td>
                                            </tr>
                                            <tr id="Tr4" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>缩略图：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:FileUpload ID="upThumbimg" runat="server" />
                                                </td>
                                            </tr>
                                           <tr id="Tr1" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>描述：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="txtDesc" runat="server" MaxLength="100" size="50" 
                                                        Height="126px" Width="361px" />
                                                </td>
                                            </tr>
                                        </table>
                                        
                                        <table width="100%" border="0">
                                            <tr>
                                                <td align="right" width="7%">
                                                发布状态：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:RadioButtonList runat="server" ID="indextop" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                                        <asp:ListItem Text="否" Value="false"  Selected="true" />
                                                        <asp:ListItem Text="是" Value="true" />
                                                    </asp:RadioButtonList>
                                                </td>
                                            </tr>
                                            
                                            <tr id="cms_mores">
                                                <td align="right">
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                                <td>
                                                </td>
                                            </tr>
                                     
                                           
                                        </table>
                                        <table width="100%" border="0">
                                            <tr>
                                                <td height="20"  align="left">
                                                    <asp:Button ID="Button1" runat="server"  OnClientClick="return Rx()" Text="确定" 
                                                        Height="19px" onclick="Button1_Click" />  
                                                    
                                                </td>
                                                <td height="20"  align="left">
                                                    &nbsp
                                                    
                                                </td>
                                                <td height="20"  >
                                                    
                                                    &nbsp
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <iframe id="wait2" name="wait2" style="display: none" width="100%" height="100%"
        src="../images/wait.gif" frameborder='0' align='middle' bgcolor='#FFFFFF'></iframe>

    <script type="text/javascript"> 

		var o;
		
		function subfunc(flag) {
			if(!isFilled(form1.title)){
				return warning('title','标题不能为空!');
			}
			
			
			if(form1.templateId.value == "0"){
				alert("请选择模板!");
				form1.templateId.focus();
				return false;
			}
			
			if(form1.articletype[0].checked == true){
			    /*var oEditor1= FCKeditorAPI.GetInstance('content');
	            
	            if(strLen(oEditor1.GetHTML())==0){
		            //return warning('nkey','内容不能为空!');
		            alert("内容不能为空!"); 
		            oEditor1.SetHTML( '' ) ; 
		            return false;
	            }*/
	            
			}else if(form1.articletype[2].checked == true){
			    if(form1.filedown.value == ""){
			        alert("请上传文件!");
			        return false;
			    }
			}else if(form1.articletype[1].checked == true){
			    if(!IsURL(form1.linkpath.value)){
			        alert("请输入合法有链接地址!");
			        form1.linkpath.focus();
			        return false;
			    }
			}
			
			
			form1.state.value = flag;
			
			return true;	
		}
		function warning(FieldName,WarningString){
				alert(WarningString);
				eval("form1." + FieldName + ".focus();");
				return(false);
		}
		function stag(){
		    
		    return true;
		}
		function addinput() {
		    var pname = $("#pname").val();
		    if (pname == "") {
		        alert("请输入添加内容的名称！");
		        return false;
		    }
		    $("#pname").val('');
		    $("#cms_mores").after("<tr><td align=\"right\">" + pname + "：</td><td></td><td><textarea name=\"_cmsinfomore_" + pname + "\" rows=\"7\" cols=\"50\" id=\"_cmsinfomore_" + pname + "\"></textarea></td></tr>");
		}
    </script>

</body>
</html>
